package com.cloudlead.plugin.security.vo;

import com.cloudlead.common.lang.persistence.AbstractIdEntity;

import com.cloudlead.plugin.security.action.validator.ScUserHasRoleValidatorGroup.*;

import javax.validation.constraints.Size;
import com.cloudlead.common.lang.annotation.BelongsTos;
import com.cloudlead.common.lang.annotation.Domain;
import com.cloudlead.plugin.security.vo.ScUser;
import com.cloudlead.common.lang.annotation.Label;
import java.lang.String;
import javax.validation.constraints.NotNull;
import com.cloudlead.plugin.security.vo.ScRole;

/**
 * ScUserHasRole is a Codegen vo type
 */
@Domain(domainClassName="com.cloudlead.plugin.security.entity.EScUserHasRole")
@BelongsTos(values = {
	@com.cloudlead.common.lang.annotation.BelongsTo(property="scRole", rootField="scRoleId")
,	@com.cloudlead.common.lang.annotation.BelongsTo(property="scUser", rootField="scUserId")
})
@Label("用户对应的角色")
public class ScUserHasRole extends AbstractIdEntity<String> {

    private static final long serialVersionUID =1743729352351L;    
    @NotNull(groups={Update.class})
    @Size(max=24)
    @Label("编号")
    private String id;

    @NotNull(groups={Create.class,Update.class})
    @Label("所属角色")
    private ScRole scRole;

    @NotNull(groups={Create.class,Update.class})
    @Label("所属用户")
    private ScUser scUser;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public ScRole getScRole() {
        return scRole;
    }

    public void setScRole(ScRole scRole) {
        this.scRole = scRole;
    }

    public ScUser getScUser() {
        return scUser;
    }

    public void setScUser(ScUser scUser) {
        this.scUser = scUser;
    }

    public String toString() {
         return String.format("ScUserHasRole { id : %s,scRole : %s,scUser : %s }",id,scRole,scUser);
    }

}

